/*
 * copyright (c) 2009 Alexandr [Sn@ble] Surnin
 *
 * This file is part of FrameSeeker.
 *
 * FrameSeeker is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FrameSeeker is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You can read the full version of GNU LGPL in
 * http://www.gnu.org/copyleft/lesser.html
 */


#ifndef FSMOTIONVECTOR_H
#define FSMOTIONVECTOR_H

#include <QObject>
#include <QPoint>

#include <QDebug>

/** A motion vector class
  * \author Alexandr [Sn@ble] Surnin
  * \note This class providing simple functionality for
  * working with motion vectors
  */
class FSMotionVector : public QObject {
    Q_OBJECT

public:
    FSMotionVector(const int mb_x = 0, const int mb_y = 0, const int mv_x = 0, const int mv_y = 0);
    FSMotionVector(const QPoint &_mb, const QPoint &_mv);
    ~FSMotionVector();

    FSMotionVector(const FSMotionVector &orig);

    FSMotionVector& operator=(const FSMotionVector &right);


    /** Get left-top coordinates of MacroBlock
      * \sa setMB(), getMV(), setMV()
      * \return MacroBlock (MB) coordinates
      */
    QPoint getMB() const;


    /** Set left-top MB coordinates
      * \sa getMB(), getMV(), setMV()
      * \rapam _mb MB coordinates, incapsulated in QPoint
      */
    void setMB(const QPoint &_mb);


    /** Get a motion vector (similary to getMB())
      * \sa getMB(), setMB(), setMV()
      * \return 2D coordinates of motion vector, incapsulated in QPoint
      */
    QPoint getMV() const;


    /** Set motion vector coordinates
      * \sa getMB(), getMV(), setMV()
      * \param _mv MV 2D coordinates
      */
    void setMV(const QPoint &_mv);


private:
    QPoint mb;
    QPoint mv;

};

#endif // FSMOTIONVECTOR_H
